<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        "use strict"
        // 注意 var a = 10, b = 10, c = 10和var a=b=c=10的区别前者相当于var a var b var c a = 10,b=10 ,c=10在严格模式下不会报错
        // 后者是：var a =10;b=10,c=10,在严格模式下会报错
        var a = 10,
            b = 11,
            c = 12;

        function test(a) {
            a = 1; //局部变量,因为在函数定义形参的时候就已经有a了相当于 var a = 10; 然后 a = 1;
            var b = 2;
            c = 3;
        }
        test(10);
        console.log(a); //10 
        console.log(b); //11
        console.log(c); //3
    </script>
</body>

</html>